﻿@model nwrole.Orchestrator.site.Models.ServiceIndexViewModel

@{
    ViewBag.Title = "Index";
}

<h2>Service</h2>

<fieldset>
    <legend>Info</legend>

    <div class="display-label">Name</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.ServiceInfo.Name)
    </div>
    
    <div class="display-label">Id</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.ServiceInfo.Id)
    </div>
    
    <div class="display-label">State</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.ServiceInfo.State)
    </div>
    
    <div class="display-label">Last registered</div>
    <div class="display-field">
        @Html.DisplayFor(model => model.ServiceInfo.LastRegistered)
    </div>
</fieldset>

<h3>Plugins</h3>
<table>
    <tr>
        <th>Display name</th>
        <th>State</th>
        <th>Last registered</th>
        <th>Id</th>
    </tr>
    
    @foreach(var plugin in Model.PluginsInfo)
    {
        <tr>
            <td>@plugin.DisplayName</td>
            <td>@plugin.State</td>
            <td>@plugin.LastRegistered</td>
            <td>@plugin.Id</td>
            <td>@Html.ActionLink("Log", "Show", "Log", new { id=plugin.Id }, null)</td>
        </tr>
    }
</table>
<p>
    @*@Html.ActionLink("Edit", "Edit", new { id = Model.ServiceInfo.Id }) |*@
    @Html.ActionLink("Back to Service list", "Details", "Supervisor", new { id = Model.ServiceInfo.SupervisorId }, null)
    <br/>
    @Html.ActionLink("Back to Supervisor list", "Index", "Supervisor")
</p>
